#ifndef _SHADOWRENDER_H_
#define _SHADOWRENDER_H_

#include "CDirect3D.h"

class ShadowMap;
class RenderItemManager;
class DepthEffect;
class ShadowEffect;
class BlurRender;

class ShadowRender
{
public:
	ShadowRender();
	ShadowRender(const ShadowRender&);
	~ShadowRender();

	void Initialize();
	void Update();
	void Render();

	ID3D11ShaderResourceView* GetTexture();

	DepthEffect* GetDepthEffect();
	ShadowEffect* GetShadowEffect();

	void ComputeLightMatrix();
private:
	void CreateTexture();

	CDirect3D* mCDirect3D;
	ID3D11DeviceContext* mDeviceContext;
	ID3D11Device* mDevice;

	int mWidth;
	int mHeight;

	ID3D11ShaderResourceView* mTextureRessource;
	ID3D11Texture2D* mTextureDepthBuffer;
	ID3D11Texture2D* mTextureRender;
	ID3D11DepthStencilView* mStencilView;
	ID3D11RenderTargetView* mRenderTargetView;

	D3D11_VIEWPORT mViewport;

	ShadowMap* mShadowMap;
	ShadowMap* mShadowLargeMap;

	DepthEffect* mDepthEffect;
	ShadowEffect* mShadowEffect;

	XMFLOAT4X4 mLightViewMatrix;
	XMFLOAT4X4 mLightProjectionMatrix;
	XMFLOAT4X4 mLightLargeViewMatrix;
	XMFLOAT4X4 mLightLargeProjectionMatrix;

	BlurRender* mBlurRender;
};
#endif